<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" > 

<html>
<head>
<base href="<%=basePath%>">
<title>会员详情</title>
<link rel="stylesheet" href="./js/bootstrap-3.3.5-dist/css/bootstrap.css" type="text/css"/>
<link rel="stylesheet" href="./js/metisMenu/metisMenu.min.css">
<link rel="stylesheet" href="./css/sb-admin/sb-admin-2.css">
<link rel="stylesheet" href="./css/base.css">
<link rel="stylesheet" href="./css/illness.css">
<link rel="stylesheet" href="./js/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="./js/bootstrap-table/bootstrap-table.min.css">
<link rel="stylesheet" href="./js/bootstrap-multiselect/bootstrap-multiselect.css" type="text/css"/>
<link rel="stylesheet" href="./js/bootstrap-3.3.5-dist/css/bootstrap-datetimepicker.css">

<script type="text/javascript" src="./js/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="./js/bootstrap-3.3.5-dist/js/bootstrap.js"></script>
<script type="text/javascript" src="./js/metisMenu/metisMenu.js"></script>
<script type="text/javascript" src="./js/common.js"></script>
<script src="./js/bootstrap-table/bootstrap-table-all.min.js"></script>
<script src="./js/bootstrap-table/bootstrap-table-zh-CN.min.js"></script>
<script src="./js/bootstrap-multiselect/bootstrap-multiselect.js"></script>
<script src="./js/bootstrap-jquery-plugin/jquery.bootstrap.js"></script>
<script src="./js/bootstrap-3.3.5-dist/js/bootstrap-datetimepicker.js"></script>
<script src="./js/bootstrap-3.3.5-dist/js/bootstrap-datetimepicker.zh-CN.js"></script>

</head>
<body>
	<jsp:include page="../template/head.jsp" />
	<jsp:include page="../template/leftnav.jsp" />
	<div id="page-wrapper">
		<div class="wrapper">
			<h1><a href="./jsp/illness/illness.jsp">会员列表</a></h1><h3> <span> > </span> 会员详情</h3>
		</div>
		<div class="bHead">
			<ul class="list-inline">	
				<li>
					<span>会员名称：</span><span id="userName1">-</span>
				</li>
			</ul>
		</div>	
		<div class="i-detail i-detail-info">
				<h3>基本信息</h3>
		    	<p>会员ID：<span id="userCode">-</span></p>
		    	<p>会员名字：<span id="userName">-</span></p>
		    	<p>会员性别：<span id="sex">-</span></p>
		    	<p>会员生日：<span id="birth">-</span></p>
		    	<p>会员电话：<span id="phone">-</span></p>
		    	<p>创建时间：<span id="createTime">-</span></p>
		</div>
		
		<div id="zDetail" class="panel bs-panel-primary" style="height: auto !important" >
			<table id="table" data-toolbar="#toolbar" data-toggle="table" data-row-style="rowStyle" data-classes="table  table-no-bordered"
	           data-minimum-count-columns="2"  data-cache="false" data-pagination="true"  data-striped="data-striped"
	           data-page-list="[5, 10, 20, 50]"  data-query-params="tableQueryParams" style="word-break:break-all;"
	           data-side-pagination="server" data-page-size=10 >
	           <thead>
					<tr class="headTr">
						<th data-field="height" data-width="12%" >身高</th>
						<th data-field="weight" data-width ="12%">体重</th>
						<th data-field="bloodPressure" data-width ="12%">血压</th>
						<th data-field="pulse" data-width ="12%">脉搏</th>
						<th data-field="abdominalLine" data-width ="12%">腹围</th>
						<th data-field="hipLine" data-width ="12%">臀围</th>
						<th data-field="createTime" data-width ="22%" data-formatter="dateFormatter">创建日期</th>
					</tr>
				</thead>
	    	</table>
		</div>
</body>
<script type="text/javascript">
	var userCode = $.getUrlParam("userCode");
	
	$(function (){
		$.ajax({
           url: "./user/getUserDetail",
           data: {
               userCode: userCode
           },
           type: "GET",
           dataType: 'json',
           cache: false,
           success: function (ret) {
              $("#userCode").html(ret.userCode);
              $("#userName1").html(ret.userName);
              $("#userName").html(ret.userName);
              $("#sex").html(ret.sex);
              $("#birth").html(getSmpFormatDateByLong(ret.birth, false));
              $("#phone").html(ret.userCode);
              $("#createTime").html(getSmpFormatDateByLong(ret.createTime, true));
           }
       });
       $('#table').bootstrapTable('refresh', {
			query : {
				offset: 0
			},
			url : "./user/getUserInfoList",
			silent : true
		});
	});
	
	function tableQueryParams(params) {
		var queryObj = {
				userCode: userCode
			};
		var newParams = $.extend(params,queryObj);
		return newParams;
	}
	
	function dateFormatter(value, row){
		if(value!=null){
			return getSmpFormatDateByLong(value, true);
		}else{
			return '-';
		}
	}
</script>
</html>
